package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Activitypeople extends AppCompatActivity {
    TextView dName,textView1,textView2;
    ImageView dImage,aImage,cImage,pImage;
    Button button_r;
    View view;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_content_details);
        //获取上一个Actvity传过来的intent
        Intent intent=getIntent();
        dName=findViewById(R.id.dname);
        dImage=findViewById(R.id.imagename);
        aImage=findViewById(R.id.imageadd);
        cImage=findViewById(R.id.imagecircle);
        pImage=findViewById(R.id.imagephone);


        //根据intent获取得到的数据设置item控件的值
        dImage.setImageResource(intent.getIntExtra("image",R.drawable.weixinone));
        dName.setText(intent.getStringExtra("details"));
        aImage.setImageResource(R.drawable.weixinone);
        cImage.setImageResource(R.drawable.weixinone);
        pImage.setImageResource(R.drawable.weixinone);
        textView1=findViewById(R.id.dphone);
        textView2=findViewById(R.id.dadd);
        textView1.setText(intent.getStringExtra("phone"));
        textView2.setText(intent.getStringExtra("region"));

        button_r=findViewById(R.id.returnButton);
        button_r.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent1=new Intent(Activitypeople.this, MainActivity.class);
                startActivity(intent1);
            }
        });

    }
}